package com.wh.custom.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wh.custom.dao.CustomEmployeelogMapper;
import com.wh.custom.dao.CustomTypeMapper;
import com.wh.custom.pojo.CustomCustomertype;
import com.wh.custom.service.ICustomCustomertypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wh.custom.pojo.CustomEmployeelog;
import com.wh.custom.service.ICustomEmployeelogService;
import com.wh.custom.dto.CustomEmployeelogDto;

import java.util.Arrays;
import java.util.List;

/**
 * 业务实现类：
 */
@Service
public class CustomEmployeelogServiceImpl extends ServiceImpl<CustomEmployeelogMapper, CustomEmployeelog> implements ICustomEmployeelogService {

    @Autowired
    private CustomEmployeelogMapper customEmployeelogMapper;

    @Override
    public IPage<CustomEmployeelog>findByPage(CustomEmployeelogDto customEmployeelogDto){
        //1.创建查询条件
        QueryWrapper<CustomEmployeelog> qw = new QueryWrapper<>();
        //qw.like("xxx",customEmployeelogDto.getXxx());
        //qw.or();
        //qw.like("xxx",customEmployeelogDto.getXxx());
        //2.组件分页数据
        IPage<CustomEmployeelog> page = new Page<>(customEmployeelogDto.getCurrentPage(), customEmployeelogDto.getPageSize());
        page.setRecords(customEmployeelogMapper.findByPage(page,qw));
        page.setTotal(customEmployeelogMapper.selectCount(qw));
        //3.返回
        return page;
    }
}
